package com.black.common.feign;

import org.springframework.http.HttpMethod;
import org.springframework.util.LinkedMultiValueMap;

import java.util.Map;

/**
 * 外部API接口定义
 *
 * @author linwenfeng
 */
public interface RestApi {

    /**
     * 请求方法
     * @return HttpMethod
     */
    default HttpMethod getHttpMethod(){
        return HttpMethod.GET;
    }

    /**
     * 额外请求头
     * @param params p
     * @return map
     */
    Map<String,String> getHttpExtraHeader(Map<String, Object> params);

    /**
     * 基本请求头
     * @return map
     */
    LinkedMultiValueMap<String,String> getHttpBasicHeader();

    /**
     * URL
     * @return url
     */
    default String getUrl(){
        return null;
    }
}
